Pin to last compatible action version in sketch compile workflow#20
Merged
Pin to last compatible action version in sketch compile workflow#20
Conversation
This library requires a modified "arduino_threads" variant of Arduino CLI. Since the time that variant was made, there
was a breaking change to the key names of Arduino CLI's JSON format output. The `arduino/compile-sketches` action uses
some of the affected keys and so had to be updated to use the new keys. A translation system was put in place to provide
backwards compatibility. However, this translation system requires that the Arduino CLI version specified via the
action's `cli-version` input be semver-compliant so that it can determine whether it came before or after the breaking
change.
The "arduino_threads" variant of Arduino CLI has the fatal combination of the old keys and non-semver version, meaning it is not compatible with versions of the `arduino/compile-sketches` action that came after the fix for the key name changes:
```
Installing platform from path: extras/ArduinoCore-mbed
Traceback (most recent call last):
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 1717, in <module>
main() # pragma: no cover
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 56, in main
compile_sketches.compile_sketches()
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 198, in compile_sketches
self.install_platforms()
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 311, in install_platforms
self.install_platforms_from_path(platform_list=platform_list.path)
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 493, in install_platforms_from_path
platform_installation_path = self.get_platform_installation_path(platform=platform)
File "/home/runner/work/_actions/arduino/compile-sketches/main/compilesketches/compilesketches.py", line 532, in get_platform_installation_path
if installed_platform[self.cli_json_key("core list", "ID")] == platform[self.dependency_name_key]:
KeyError: 'id'
```
The workaround is to pin version of the `arduino/compile-sketches` action used in the "Compile Examples" workflow to the
last compatible ref. Fortunately, that is quite recent in the action's revision history and none of the changes that came
since should be relevant for this application.
Collaborator
|
I'll try to forward-port the patch on newer arduino-cli in the next few days 😉 |
Contributor
That would be terrific, @facchinm 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This library requires a modified "arduino_threads" variant of Arduino CLI. Since the time that variant was made, there was a breaking change to the key names of Arduino CLI's JSON format output (arduino/arduino-cli#1223). The
arduino/compile-sketchesaction uses some of the affected keys and so had to be updated to use the new keys (arduino/compile-sketches#20). A translation system was put in place to provide backwards compatibility. However, this translation system requires that the Arduino CLI version specified via the action'scli-versioninput be semver-compliant so that it can determine whether it came before or after the breaking change.The "arduino_threads" variant of Arduino CLI has the fatal combination of the old keys and non-semver version, meaning it is not compatible with versions of the
arduino/compile-sketchesaction that came after the fix for the key name changes, which results in a spurious failure of the workflow runs.For example:
https://github.com/bcmi-labs/Arduino_Threads/pull/19/checks?check_run_id=3674417845#step:6:198
The workaround is to pin version of the
arduino/compile-sketchesaction used in the "Compile Examples" workflow to thelast compatible ref. Fortunately, that is quite recent in the action's revision history and none of the changes that came since should be relevant for this application.